package com.at.abc.r420_ak;

import java.io.*;
import java.util.*;

public class g {
    static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    static PrintWriter out = new PrintWriter(System.out);

    public static void main(String[] args) throws Exception {
        long x = Long.parseLong(br.readLine().trim());
        long Y = 4L * x - 1L; // 关键：Y = 4X - 1

        Set<Long> set = new HashSet<>(); // 去重
        long absY = Math.abs(Y);
        for (long d = 1; d * d <= absY; d++) {
            if (absY % d != 0) continue;
            long d2 = absY / d;

            // 对于 Y>0，因子对为 (d, d2) 和 (-d, -d2)
            // 对于 Y<0，因子对为 (d, -d2) 和 (-d, d2)
            long[][] pairs;
            if (Y > 0) {
                pairs = new long[][]{{d, d2}, {-d, -d2}};
            } else {
                pairs = new long[][]{{d, -d2}, {-d, d2}};
            }

            for (long[] uv : pairs) {
                long u = uv[0], v = uv[1];
                // 要求 (u+v) 能整除 2，且 A = (u+v)/2 = 2k 必须为偶数 -> (u+v) % 2 == 0 and A % 2 == 0
                if (((u + v) & 1L) != 0) continue;
                long A = (u + v) / 2; // A = 2k
                long B = (v - u) / 2; // B = 2n+1

                // A must be even (A=2k) => A % 2 == 0
                if ((A & 1L) != 0) continue;
                // B must be odd (B=2n+1) => (B-1) must be even
                if (((B - 1L) & 1L) != 0) continue;

                long n = (B - 1L) / 2L;
                // 如果只需要非负整数 n，可以加下列判断：
                // if (n >= 0) set.add(n);
                set.add(n);
            }
        }

        List<Long> ans = new ArrayList<>(set);
        Collections.sort(ans);
        out.println(ans.size());
        for (int i = 0; i < ans.size(); i++) {
            if (i > 0) out.print(" ");
            out.print(ans.get(i));
        }
        out.println();
        out.flush();
    }
}
